<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('康熙字典列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <p>字：</p>
                                <input type="text" name="zi"/>
                            </li>
                            <li>
                                <p>繁体：</p>
                                <input type="text" name="fanti"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="dict:kangxizi:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="dict:kangxizi:export">
                    <i class="fa fa-download"></i> 导出
                 </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('dict:kangxizi:edit')}]];
        var removeFlag = [[${@permission.hasPermi('dict:kangxizi:remove')}]];
        var prefix = ctx + "dict/kangxizi";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "康熙字典",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'id', 
                    title : 'id',
                    visible: false
                },
                {
                    field : 'zi', 
                    title : '字'
                },
                {
                    field : 'fanti', 
                    title : '繁体'
                },
                {
                    field : 'yiti', 
                    title : '异体'
                },
                {
                    field : 'pinyin', 
                    title : '拼音'
                },
                {
                    field : 'zhuyin', 
                    title : '注音'
                },
                {
                    field : 'bushou', 
                    title : '部首'
                },
                {
                    field : 'bushouBihua', 
                    title : '部首笔画'
                },
                {
                    field : 'zhongBihua', 
                    title : '总笔画'
                },
                {
                    field : 'kangxiBihua', 
                    title : '康熙笔划'
                },
                {
                    field : 'wubi86', 
                    title : '五笔86'
                },
                {
                    field : 'wubi98', 
                    title : '五笔98'
                },
                {
                    field : 'cangjie', 
                    title : '仓颉'
                },
                {
                    field : 'sijiao', 
                    title : '四角号码'
                },
                {
                    field : 'unicode', 
                    title : 'unicode'
                },
                {
                    field : 'guifanCode', 
                    title : '规范编码'
                },
                {
                    field : 'hanziWuxing', 
                    title : '汉字五行'
                },
                {
                    field : 'jixiong', 
                    title : '吉区寓意'
                },
                {
                    field : 'changYong', 
                    title : '常用字'
                },
                {
                    field : 'xingmingXue', 
                    title : '姓名学'
                },
                {
                    field : 'kangxiIndex', 
                    title : '字典索引'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        //actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>